home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
SPACE 2
/
SPACE - Library 2 - Volume 1.iso
/
program
/
561
/
prolog
/
editor.toy
< prev
next >
Wrap
Text File
|
1991-09-08
|
4KB
|
191 lines
'edit'('/'(:0, :1)) :
'not'(','('atom'(:0), 'integer'(:1))) .
'!' .
'write'('Bad parameters : ') .
'write'('edit'('/'(:0, :1))) .
'nl' .
'fail' .
[]
'edit'('/'(:0, :1)) :
'predefined'(:0, :1) .
'!' .
'write'('Can''t edit system routine : ') .
'write'('/'(:0, :1)) .
'nl' .
'fail' .
[]
'edit'(:0) :
'tag'('ed'(:0, 0)) .
[]
'ed'(:0, :1) :
'show'(:0, :1) .
'!' .
'docmd'(:0, :1, :2) .
'ed'(:0, :2) .
[]
'ed'(:0, :1) :
'display'('Cursor out of range : ') .
'display'(:1) .
'nl' .
'ed'(:0, 0) .
[]
'docmd'(:0, :1, :2) :
'repeat' .
'getline'(:3) .
'cmd'(:3, :0, :1, :2) .
'!' .
[]
'getline'('[]') :
'rch' .
'lastch'(:0) .
'iseoln'(:0) .
'!' .
[]
'getline'(:0 . :1) :
'lastch'(:0) .
'getline'(:1) .
[]
'cmd'('[]', :0, :1, :2) :
'next_cursor'(:0, :1, :2) .
[]
'cmd'('+' . '[]', :0, :1, :2) :
'next_cursor'(:0, :1, :2) .
[]
'cmd'('-' . '[]', :0, :1, :2) :
'prev_cursor'(:1, :2) .
[]
'cmd'('t' . '[]', :0, :1, 0) :
[]
'cmd'('b' . '[]', :0, :1, :2) :
'bottom_cursor'(:0, :1, :2) .
[]
'cmd'('l' . '[]', :0, :1, :1) :
'listing'(:0) .
[]
'cmd'('d' . '[]', :0, :1, :2) :
'delete'(:0, :1, :2) .
[]
'cmd'('i' . '[]', :0, :1, :2) :
'insert'(:0, :1, :2) .
[]
'cmd'('f' . ' ' . :0, :1, :2, :3) :
'file_insert'(:0, :1, :2, :3) .
[]
'cmd'('e' . ' ' . :0, :1, :2, :3) :
'append'(:4, '/' . :5, :0) .
'call_edit'(:4, :5) .
[]
'cmd'('x' . '[]', :0, :1, :2) :
'tagexit'('ed'(:3, :4)) .
[]
'cmd'('p' . '[]', :0, :1, :1) :
'invoke_Prolog' .
[]
'cmd'(:0, :1, :2, :3) :
'display'('--- incorrect command : ') .
'writetext'(:0) .
'nl' .
'fail' .
[]
'next_cursor'('/'(:0, :1), :2, :3) :
'is'(:3, '+'(:2, 1)) .
'check'('clause'(:0, :1, :3, :4, :5)) .
'!' .
[]
'next_cursor'(:0, :1, :1) :
[]
'prev_cursor'(0, 0) :
[]
'prev_cursor'(:0, :1) :
'>'(:0, 0) .
'is'(:1, '-'(:0, 1)) .
[]
'bottom_cursor'('/'(:0, :1), :2, :3) :
'is'(:4, '+'(:2, 1)) .
'check'('clause'(:0, :1, :4, :5, :6)) .
'!' .
'bottom_cursor'('/'(:0, :1), :4, :3) .
[]
'bottom_cursor'(:0, :1, :1) :
[]
'delete'(:0, 0, 0) :
'!' .
'display'('Can''t delete clause 0') .
'nl' .
[]
'delete'('/'(:0, :1), :2, :3) :
'retract'(:0, :1, :2) .
'cursor_in_range'(:0, :1, :2, :3) .
[]
'cursor_in_range'(:0, :1, :2, :2) :
'check'('clause'(:0, :1, :2, :3, :4)) .
'!' .
[]
'cursor_in_range'(:0, :1, :2, :3) :
'is'(:3, '-'(:2, 1)) .
[]
'insert'(:0, :1, :2) :
'repeat' .
'read'(:3) .
'convert'(:3, :4, :5) .
'accept'(:4, :0, :3) .
'!' .
'end_or_proceed'(:4, :5, :0, :1, :2) .
[]
'end_or_proceed'('end', '[]', :0, :1, :1) :
'!' .
[]
'end_or_proceed'(:0, :1, :2, :3, :4) :
'is'(:5, '+'(:3, 1)) .
'assert'(:0, :1, :3) .
'insert'(:2, :5, :4) .
[]
'accept'(:0, :1, 'end') :
[]
'accept'(:0, '/'(:1, :2), :3) :
'functor'(:0, :1, :2) .
[]
'accept'(:0, :1, :2) :
'display'('--- clause not in edited procedure - ignored') .
'nl' .
'write'(:2) .
'fail' .
[]
'file_insert'(:0, :1, :2, :3) :
'pname'(:4, :0) .
'see'(:4) .
'insert'(:1, :2, :3) .
'seen' .
'see'('user') .
[]
'call_edit'(:0, :1) :
'pname'(:2, :0) .
'pnamei'(:3, :1) .
'edit'('/'(:2, :3)) .
[]
'invoke_Prolog' :
'tag'('loop') .
[]
'invoke_Prolog' :
[]
'show'(:0, 0) :
'!' .
'write'('[0] ( ') .
'write'(:0) .
'write'(' )') .
'nl' .
[]
'show'('/'(:0, :1), :2) :
'side_effects'(','('clause'(:0, :1, :2, :3, :4), ','('conv_body'(:5, :4), ','('display'('['), ','('display'(:2), ','('display'('] '), ','('writeclause'(:3, :5), ','('display'('.'), 'nl')))))))) .
[]
'append'('[]', :0, :0) :
[]
'append'(:0 . :1, :2, :0 . :3) :
'append'(:1, :2, :3) .
[]
:
'seen' .
[]#